<h2>Why is this an issue?</h2>
<p>Alternation is used to match a single regular expression out of several possible regular expressions. If one of the alternatives is empty it would
match any input, which is most probably a mistake.</p>
<h3>Noncompliant code example</h3>
<pre>
/Jack|Peter|/.test('John'); // Noncompliant - returns 'true'
/Jack||Peter/.test('John'); // Noncompliant - returns 'true'
</pre>
<h3>Compliant solution</h3>
<pre>
/Jack|Peter/.test('John'); // returns 'false'
</pre>
<h3>Exceptions</h3>
<p>One could use an empty alternation to make a regular expression group optional. Rule will not report on such cases.</p>
<pre>
/mandatory(-optional|)/.test('mandatory'); // returns 'true'
/mandatory(-optional|)/.test('mandatory-optional'); // returns 'true'
</pre>
<p>However, if there is a quantifier after the group the issue will be reported as using both <code>|</code> and quantifier is redundant.</p>
<pre>
/mandatory(-optional|)?/.test('mandatory'); // Noncompliant - using both `|` inside the group and `?` for the group.
</pre>
